<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>title</title>
	<link rel="stylesheet" type="text/css" href="../css/api.css" />
	<!-- <link rel="stylesheet" type="text/css" href="../css/menu.css" /> -->
	<link rel="stylesheet" type="text/css" href="../css/mzui/css/mzui.min.css" />
	<style>
		th {
			text-align: center;
		}

		td {
			text-align: center;
		}

		html,
		body {
			background-color: #fff;
		}

		.infoTop {
			background-color: #2f889a;
			height: 73px;
			/* border-bottom:1px solid #994c00; */
			text-align: center;
			/* border:1px solid red; */
		}

		.infoTop a {
			position: absolute;
			height: 37px;
			padding: 34px 20px 0 20px;
			top: 0px;
			left: 0px;
			cursor: pointer;
		}

		.infoTop img {
			height: 25px;
		}

		.infoTop span {
			position: absolute;
			top: 24px;
			left: 150px;
			font-size: 20px;
			height: 50px;
			line-height: 50px;
			color: #fff;
			cursor: default;
		}

		.infoTop .nav {
			float: right;
			width: 25px;
			height: 25px;
			margin: 35px 15px auto 20px;
		}
	</style>
</head>

<body>




	<div class="content box" style="background-color: #FFFFFF">
		<!-- <a id="closeF" onClick="javascript :api.closeFrame();" style="float: right;display: none;"> 关闭</a>-->
		<table class="table bordered">
			<thead>
				<tr>
					<!-- <th>产品名称</th>
					<th>铸件号</th> -->
					<th>包次</th>
					<th>炉次</th>
					<th>材质</th>
					<!-- <th>浇注数量</th> -->
					<th>浇注日期</th>
					<th>试块编号</th>

				</tr>
			</thead>
			<tbody id='tbody'>
				<!-- <tr>
                        <td>生铁</td>
                        <td>1526</td>
                        <td>吨</td>
                        <td>8</td>
                    </tr> -->
			</tbody>
		</table>
	</div>



</body>
<script type="text/javascript" src="../script/public/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/core/core.js"></script>
<!--<script type="text/javascript" src="../script/mzui/js/mzui.min.js"></script>-->
<script type="text/javascript">
	apiready = function() {

		var meltingStove = api.pageParam.meltingStove; //铸件号
		var meltingWrap = api.pageParam.meltingWrap; //产品名称
		var texture = api.pageParam.texture; //产品名称

		ajaxLocal({
			meltingStove: meltingStove,
			meltingWrap: meltingWrap,
			texture:texture
		}, 'blockInventory', 'listPouring', function(ret, err) {
			//alert("验证成功!!"+JSON.stringify(ret.list));

			html = '';

			for (var i = 0; i < ret.list.length; i++) {
				html +=
					'<tr onclick="changeMa(\''
					+ ret.list[i].packetCode + '\',\''
					+ ret.list[i].furnaceCode + '\',\''
					+ ret.list[i].texture + '\',\''
					+ ret.list[i].planActualEndTime + '\',\''
					+ ret.list[i].pieceNo + '\')">' +
					'<td>' + ret.list[i].packetCode + '</td>';
					//'<td>' + ret.list[i][1] + '</td>';
				if(ret.list[i].furnaceCode == null){
					html += '<td></td>';
				} else {
					html += '<td>' + ret.list[i].furnaceCode + '</td>';
				}
				if (ret.list[i].texture == null) {
					html += '<td></td>';
				} else {
					html += '<td>' + ret.list[i].texture + '</td>'
				}
				if (ret.list[i].planActualEndTime == null) {
					html += '<td></td>'
				} else {
					html += '<td>' + ret.list[i].planActualEndTime + '</td>'
				}
				if (ret.list[i].pieceNo == null) {
					html += '<td></td>'
				} else {
					html += '<td>' + ret.list[i].pieceNo + '</td>'
				}

				html +=	'</tr>';
			}

			$api.html($api.byId('tbody'), html);

		});
		//右滑打开菜单
		//		api.addEventListener({
		//		    name:'swiperight'
		//		}, function(ret, err){
		//		   api.openFrame({
		//	           name: 'leftMenu',
		//	           url: 'left_menu.html',
		//	           rect: {
		//		           x:0,
		//		           y:0,
		//		           w:api.winWidth/2,
		//		           h:api.winHeight
		//	           }
		//         });
		//		});

		//测试--不能触屏

		$("#openMenu").click(function() {
			api.openFrame({
				name: 'leftMenu',
				url: 'left_menu.html',
				rect: {
					x: 0,
					y: 0,
					w: api.winWidth / 2,
					h: api.winHeight
				}
			});
		});
	};

	function changeMa( meltingWrap,meltingStove, texture, pureTime,blockNo) {
		api.openWin({
			name: 'win_inStorageForOne',
			url: 'win_inStorageForOne.html',
			reload: true,
			pageParam: {
				meltingStove: meltingStove,
				meltingWrap: meltingWrap,
				texture: texture,
				pureTime: pureTime,
				blockNo:blockNo
			},
			rect: {
				x: 0,
				y: 0,
				w: 'auto',
				h: 'auto'
			}
		});

	}
</script>

</html>
